<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="next" href="Intermediate.intermediateCode.html">
<link rel="Up" href="Intermediate.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class attributes" rel=Appendix href="index_attributes.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Commands" rel="Chapter" href="Commands.html">
<link title="Declaration" rel="Chapter" href="Declaration.html">
<link title="Exceptions" rel="Chapter" href="Exceptions.html">
<link title="Expressions" rel="Chapter" href="Expressions.html">
<link title="Intermediate" rel="Chapter" href="Intermediate.html">
<link title="Lexer" rel="Chapter" href="Lexer.html">
<link title="Main" rel="Chapter" href="Main.html">
<link title="Parser" rel="Chapter" href="Parser.html">
<link title="Print" rel="Chapter" href="Print.html">
<link title="Print_syntaxtree" rel="Chapter" href="Print_syntaxtree.html">
<link title="Semantic" rel="Chapter" href="Semantic.html">
<link title="Subroutines" rel="Chapter" href="Subroutines.html">
<link title="Syntaxtree" rel="Chapter" href="Syntaxtree.html">
<link title="Target" rel="Chapter" href="Target.html"><title>Intermediate.funUtils</title>
</head>
<body>
<div class="navbar">&nbsp;<a href="Intermediate.html">Up</a>
&nbsp;<a href="Intermediate.intermediateCode.html">Next</a>
</div>
<center><h1>Class <a href="type_Intermediate.funUtils.html">Intermediate.funUtils</a></h1></center>
<br>
<pre><span class="keyword">class</span> <a name="TYPEfunUtils"></a>funUtils : <code class="type"></code><code class="code">object</code> <a href="Intermediate.funUtils.html">..</a> <code class="code">end</code></pre>The class contains all the method and objects which differ from one subroutine and the other, 
or the main program<br>
<hr width="100%">
<pre><span class="keyword">val</span> <a name="ATTinl"></a><span class="keyword">mutable</span> <a href="code_ATTIntermediate.funUtils.inl.html">inl</a> : <code class="type"><a href="Intermediate.html#TYPEinstruction">instruction</a> list</code></pre><div class="info">
The intermediate code instruction list<br>
</div>
<pre><span class="keyword">val</span> <a name="ATTlabel_table"></a><span class="keyword">mutable</span> <a href="code_ATTIntermediate.funUtils.label_table.html">label_table</a> : <code class="type">(int, <a href="Intermediate.html#TYPEelement">element</a>) Hashtbl.t</code></pre><div class="info">
The table which bind an instruction number with a Label<br>
</div>
<pre><span class="keyword">val</span> <a name="ATTlabelC"></a><span class="keyword">mutable</span> <a href="code_ATTIntermediate.funUtils.labelC.html">labelC</a> : <code class="type"><a href="Intermediate.html#TYPElabel">label</a></code></pre><div class="info">
The label counter<br>
</div>
<pre><span class="keyword">val</span> <a name="ATToffcount"></a><span class="keyword">mutable</span> <a href="code_ATTIntermediate.funUtils.offcount.html">offcount</a> : <code class="type"><a href="Intermediate.html#TYPEoffset">offset</a></code></pre><div class="info">
The offset counter (which is the next offset for a new variable)<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODaddInstr"></a><a href="code_METHODIntermediate.funUtils.addInstr.html">addInstr</a> : <code class="type"><a href="Intermediate.html#TYPEinstruction">instruction</a> -> unit</code></pre><div class="info">
Add an instruction to the list<br>
</div>
<div class="param_info"><code class="code">i</code> : The instruction to be added</div>
<pre><span class="keyword">method</span> <a name="METHODgetInstr"></a><a href="code_METHODIntermediate.funUtils.getInstr.html">getInstr</a> : <code class="type">int -> <a href="Intermediate.html#TYPEinstruction">instruction</a></code></pre><div class="info">
Get the i-th instruction from the list<br>
<b>Returns</b> The instruction at position i<br>
</div>
<div class="param_info"><code class="code">i</code> : The position number</div>
<pre><span class="keyword">method</span> <a name="METHODgetInl"></a><a href="code_METHODIntermediate.funUtils.getInl.html">getInl</a> : <code class="type"><a href="Intermediate.html#TYPEinstruction">instruction</a> list</code></pre><div class="info">
Get all the instruction list<br>
<b>Returns</b> The instruction list<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODgetIc"></a><a href="code_METHODIntermediate.funUtils.getIc.html">getIc</a> : <code class="type">int</code></pre><div class="info">
Get the instruction counter (how many instructions have been added)<br>
<b>Returns</b> The number of added instructions<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODstack"></a><a href="code_METHODIntermediate.funUtils.stack.html">stack</a> : <code class="type"><a href="Intermediate.html#TYPEoffset">offset</a></code></pre><div class="info">
Return the next offset from the stack pointer<br>
<b>Returns</b> The next offset<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODincLabel"></a><a href="code_METHODIntermediate.funUtils.incLabel.html">incLabel</a> : <code class="type"><a href="Intermediate.html#TYPElabel">label</a></code></pre><div class="info">
Increments the label counter<br>
<b>Returns</b> the next label index<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODaddLabel"></a><a href="code_METHODIntermediate.funUtils.addLabel.html">addLabel</a> : <code class="type"><a href="Intermediate.html#TYPEelement">element</a> -> int -> unit</code></pre><div class="info">
Add a new label to the table<br>
</div>
<div class="param_info"><code class="code">lab</code> : The label to add</div>
<div class="param_info"><code class="code">ip</code> : The instruction pointer to binf with the label</div>
<pre><span class="keyword">method</span> <a name="METHODgetLabel"></a><a href="code_METHODIntermediate.funUtils.getLabel.html">getLabel</a> : <code class="type"><a href="Intermediate.html#TYPEelement">element</a></code></pre><div class="info">
Create a new label<br>
<b>Returns</b> A new Label<br>
</div>
<pre><span class="keyword">method</span> <a name="METHODhasLabel"></a><a href="code_METHODIntermediate.funUtils.hasLabel.html">hasLabel</a> : <code class="type">int -> bool</code></pre><div class="info">
Check if an instruction is binded with a label<br>
<b>Returns</b> True if the instruction is binded with a label, false otherwise<br>
</div>
<div class="param_info"><code class="code">i</code> : The index to check</div>
<pre><span class="keyword">method</span> <a name="METHODgetInstrLabel"></a><a href="code_METHODIntermediate.funUtils.getInstrLabel.html">getInstrLabel</a> : <code class="type">int -> <a href="Intermediate.html#TYPEelement">element</a></code></pre><div class="info">
Retrive the label binded with an instruction<br>
<b>Returns</b> The label binded with the instruction<br>
</div>
<div class="param_info"><code class="code">i</code> : The instruction associated with a label</div>
</body></html>